#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <iostream>

int main(int argc, char* argv[])
{

    int fd = open("/dev/hello", O_RDWR, S_IRUSR|S_IWUSR);
    if(fd != -1)
    {
        void* paddr = nullptr;
        int res = ioctl(fd, 0xC0506D14, (unsigned long)&paddr);;
        std::cout<< "alloc memory: " << paddr << std::endl;
        *(int*)paddr = 0x12345678;

	    close(fd);
    }
    else
    {
        perror("Failed at open():");
    }
    return 0;
}

